import nme.Assets;
import nme.display.Sprite;
import nme.display.Bitmap;
import nme.display.BitmapData;
import nme.display.Tilesheet;

import nme.geom.Rectangle;
import nme.geom.Matrix;
import nme.geom.Point;

class Frame extends Sprite
{
	private var _id:String;
	private var _sprite:SpriteData;
	private var _frameData:FrameData;
	private var _matrix:Matrix;
	private var _bitmap:BitmapData;
	
	public function new (sprite:SpriteData, id:String)
	{
		super ();
		_id = id;
		_sprite = sprite;
		_frameData = _sprite._frames.get(_id);
		// _bitmap = _sprite.getFrame(_id).clone();
		_matrix = new Matrix (1, 0, 0, 1, _frameData._bound.x, _frameData._bound.y);
		
		graphics.clear ();
		// _frameData.toGraphics (graphics);
		graphics.drawTiles (_sprite._tileSheet, _frameData.getTileData (), true, Tilesheet.TILE_TRANS_2x2);
	}
	
	public function update ():Void
	{
	}
	
	public function render ():Void
	{
	}
}